//
//  BankListView.m
//  YTwallet
//
//  Created by ZhangLin on 2019/3/26.
//  Copyright © 2019年 hadrlog. All rights reserved.
//

#import "BankListView.h"
#import <Masonry.h>
@implementation BankListView


-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setupViews];
    }
    return self;
}

-(void)setupViews
{
    self.backgroundColor = [UIColor clearColor];
    
    self.backgroundView = [[UIView alloc] initWithFrame:(CGRectMake(0, ETScreenH - 400, ETScreenW, 400))];
    self.backgroundView.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.backgroundView];
    
    
    self.topView = [[UIView alloc] init];
    self.topView.backgroundColor = [UIColor whiteColor];
    self.topView.frame = CGRectMake(0, 0, ETScreenW, 44);
    [self.backgroundView addSubview:self.topView];
    
    self.bankNameView = [[UIView alloc] init];
    self.bankNameView.backgroundColor = [UIColor whiteColor];
    [self.topView addSubview:self.bankNameView];
    [self.bankNameView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.equalTo(self.topView);
        make.height.mas_equalTo(44);
    }];
    
    self.banlNameLab = [[UILabel alloc] init];
    self.banlNameLab.text = @"请选择银行";
    self.banlNameLab.textColor = ETColorWithRGB(51, 51, 51);
    self.banlNameLab.font = [UIFont boldSystemFontOfSize:14];
    [self.bankNameView addSubview:self.banlNameLab];
    [self.banlNameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.centerY.equalTo(self.bankNameView);
    }];
    
    self.offBtn = [UIButton buttonWithType:(UIButtonTypeCustom)];
    [self.offBtn setImage:[UIImage imageNamed:@"icon_off"] forState:(UIControlStateNormal)];
    [self.bankNameView addSubview:self.offBtn];
    [self.offBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(-15);
        make.centerY.equalTo(self.bankNameView);
        make.width.mas_equalTo(16);
        make.height.mas_equalTo(16);
    }];
    
    self.lineView = [[UIView alloc] init];
    self.lineView.backgroundColor = ETTableViewLineColor;
    [self.topView addSubview:self.lineView];
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.bottom.equalTo(self.topView);
        make.height.mas_equalTo(ETTableViewLineHeight);
    }];
    
    /*
    self.searchView = [[UIView alloc] init];
    self.searchView.backgroundColor = [UIColor whiteColor];
    [self.topView addSubview:self.searchView];
    [self.searchView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.top.equalTo(self.bankNameView.mas_bottom);
        make.height.mas_equalTo(130 - 44);
    }];
    
    self.searchBar = [[UISearchBar alloc] init];
    [self.searchView addSubview:self.searchBar];
    [self.searchBar mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(15);
        make.right.mas_equalTo(-15);
        make.centerY.equalTo(self.searchView);
        make.height.mas_equalTo(44);
    }];
     */
    
    
    
    self.bankListTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 44, ETScreenW, 400 - 44) style:(UITableViewStyleGrouped)];
    self.bankListTableView.backgroundColor =[UIColor whiteColor];
    self.bankListTableView.separatorStyle = UITableViewCellSelectionStyleNone;
    [self.backgroundView addSubview:self.bankListTableView];
    
}

@end
